package com.designoutput.utils
{
	public class UnitUtils
	{
		public static function convert(value:Number, currentUnit:Unit, targetUnit:Unit, precision:int = 2):Number {
			if(currentUnit == targetUnit)
				return value;
			
			value = currentUnit.toDefaultUnit(value);
			value = targetUnit.fromDefaultUnit(value)
			
			return MathUtils.round(value, precision);
		}
	}
}